/*    */ package system.staros.ablock2;
/*    */ 
/*    */ import java.io.File;
/*    */ import java.io.PrintStream;
/*    */ import javax.xml.parsers.DocumentBuilder;
/*    */ import javax.xml.parsers.DocumentBuilderFactory;
/*    */ import org.w3c.dom.Document;
/*    */ import org.w3c.dom.Element;
/*    */ import org.w3c.dom.Node;
/*    */ import org.w3c.dom.NodeList;
/*    */ 
/*    */ public class XMLReader
/*    */ {
/* 11 */   public static String verSsS = "";
/*    */ 
/*    */   public static void parseXML()
/*    */   {
/*    */     try {
/* 16 */       File localFile = new File("system/data/staros/update/cache/latest.xml");
/* 17 */       DocumentBuilderFactory localDocumentBuilderFactory = DocumentBuilderFactory.newInstance();
/* 18 */       DocumentBuilder localDocumentBuilder = localDocumentBuilderFactory.newDocumentBuilder();
/* 19 */       Document localDocument = localDocumentBuilder.parse(localFile);
/* 20 */       localDocument.getDocumentElement().normalize();
/*    */ 
/* 23 */       NodeList localNodeList = localDocument.getElementsByTagName("latest");
/* 24 */       System.out.println("-----------------------");
/*    */ 
/* 26 */       for (int i = 0; i < localNodeList.getLength(); i++)
/*    */       {
/* 28 */         Node localNode = localNodeList.item(i);
/* 29 */         if (localNode.getNodeType() == 1)
/*    */         {
/* 31 */           Element localElement = (Element)localNode;
/* 32 */           verSsS = getTagValue("version", localElement);
/* 33 */           System.out.println("Latest version : " + getTagValue("version", localElement));
/*    */         }
/*    */       }
/*    */     }
/*    */     catch (Exception localException)
/*    */     {
/* 39 */       localException.printStackTrace();
/*    */     }
/*    */   }
/*    */ 
/*    */   private static String getTagValue(String paramString, Element paramElement) {
/* 44 */     NodeList localNodeList = paramElement.getElementsByTagName(paramString).item(0).getChildNodes();
/*    */ 
/* 46 */     Node localNode = localNodeList.item(0);
/*    */ 
/* 48 */     return localNode.getNodeValue();
/*    */   }
/*    */ }

/* Location:           D:\Марк\!IMPORTANT\staros\archive\version-2.260.zip
 * Qualified Name:     system.staros.ablock2.XMLReader
 * JD-Core Version:    0.6.1
 */